package main

import (
	"flag"
	"fmt"
)

var env string
var port int

// 使用方式
// go run read_args_with_flag.go
// go run read_args_with_flag.go -env=prod
// go run read_args_with_flag.go -env=prod -port=8888
func main() {
	flag.StringVar(&env, "env", "dev", "which env do you want")
	flag.IntVar(&port, "port", 8080, "which port do you want")
	flag.Parse()
	fmt.Printf("env=%s, port=%d\n", env, port)
}
